<template>
  <div>
<MyHeader></MyHeader>
  
<div class="min">
  <MyGoods v-for="obj in list" :key="obj.id" :objs="obj"></MyGoods>
</div>

<MyFooter @chengFn='chengFns' :arr='list'></MyFooter>
  </div>
</template>

<script>
import MyHeader from './components/MyHeader.vue'
import MyFooter from './components/MyFooter.vue'
import MyGoods from './components/MyGoods.vue'
import MyCount from './components/MyCount.vue'
export default {
components:{
MyHeader,
MyFooter,
MyGoods,
MyCount,
},
data () {
  return {
  list:[]  
  }
},
created () {
  this.$axios({
     url: "/api/cart"
  }).then(res=>{
    console.log(res);
    this.list=res.data.list
  })
},
methods:{
  chengFns(val){
this.list.forEach(item=> {
  item.goods_state=val
});
  }
}
}
</script>

<style>
.min{
  margin-top: 40px;
}
</style>